{
 "cells": [
  {
   "cell_type": "raw",
   "metadata": {
    "raw_mimetype": "text/restructuredtext"
   },
   "source": [
    ".. _nb_kgb:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "# KGB-DMOEA: Knowledge-Guided Bayesian Dynamic Multi-Objective Evolutionary Algorithm"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "KGB-DMOEA is a sophisticated evolutionary algorithm for dynamic multi-objective optimization problems (DMOPs). It employs a knowledge-guided Bayesian classification approach to adeptly navigate and adapt to changing Pareto-optimal solutions in dynamic environments. This algorithm utilizes past search experiences, distinguishing them as beneficial or non-beneficial, to effectively direct the search in new scenarios."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Key Features\n",
    "\n",
    "\n",
    "- **Knowledge Reconstruction-Examination (KRE):** Dynamically re-evaluates historical optimal solutions based on their relevance and utility in the current environment. \n",
    "- **Bayesian Classification:** Employs a Naive Bayesian Classifier to forecast high-quality initial populations for new environments.\n",
    "- **Adaptive Strategy:** Incorporates dynamic parameter adjustment for optimized performance across varying dynamic contexts.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "from pymoo.algorithms.moo.kgb import KGB\n",
    "from pymoo.core.callback import CallbackCollection\n",
    "from pymoo.optimize import minimize\n",
    "from pymoo.problems.dyn import TimeSimulation\n",
    "from pymoo.problems.dynamic.df import DF1\n",
    "\n",
    "from pymoo.visualization.video.callback_video import ObjectiveSpaceAnimation\n",
    "\n",
    "problem = DF1(taut=2, n_var=2)\n",
    "\n",
    "algorithm = KGB()\n",
    "\n",
    "res = minimize(problem,\n",
    "               algorithm,\n",
    "               termination=('n_gen', 10),\n",
    "               callback=TimeSimulation(),\n",
    "               seed=1,\n",
    "               verbose=False)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "tags": []
   },
   "source": [
    "### Parameters \n",
    "\n",
    "- **perc_detect_change (float, optional):** Proportion of the population used to detect environmental changes. \n",
    "- **perc_diversity (float, optional):** Proportion of the population allocated for introducing diversity. \n",
    "- **c_size (int, optional):** Cluster size.\n",
    "- **eps (float, optional):** Threshold for detecting changes. Default: \n",
    "- **pertub_dev (float, optional):** Deviation for perturbation in diversity introduction. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### References"
   ]
  },
  {
   "cell_type": "raw",
   "metadata": {},
   "source": [
    "Yulong Ye, Lingjie Li, Qiuzhen Lin, Ka-Chun Wong, Jianqiang Li, Zhong Ming. “A knowledge guided Bayesian classification for dynamic multi-objective optimization”. Knowledge-Based Systems, Volume 251, 2022."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
